from flask import Flask
from dotenv import load_dotenv
from routes import routes
import os
from config import UPLOAD_FOLDER

load_dotenv()

app = Flask(__name__)

for route in routes:
    app.register_blueprint(route["blueprint"], url_prefix=route["url_prefix"])

if not os.path.exists(UPLOAD_FOLDER):
    os.makedirs(UPLOAD_FOLDER)

app.config['UPLOAD_FOLDER'] = UPLOAD_FOLDER

if __name__ == "__main__":
    for i in app.iter_blueprints():
        print(i)
    app.run(debug=True)
